<% if !@m.is_reply %>
	<% if @type != "private" %>
		<% author = Entity.find(@m.public_author_id) %>
		<% if (author.can_have_stream_seen_by(Entity.find(session[:user_id]))) %>
			<div class="single_popsicle_message">				
				<% count = 0 %>
				<% @m.get_responses.each do |r| %>
					<% style = "border-bottom:dashed" %>
					<% if count > 0 %>
						<% style += ";padding-left:5%" %>				
					<% end %>
					<div class="single_popsicle_response" style="<%= style %>" >
						<% respondent = Entity.find(r.public_author_id) %>
						<% @author_or_response = ((count > 0) ? " replies: " : " says: ") %>
						<% if count > 0 %>
							<h5>						
						<% else %>
							<h4>
						<% end %>
						<% if respondent.id == session[:user_id] %>
							<%= link_to(respondent.name, entity_path(respondent), :class => "entity_link") %><%= @author_or_response %>
						<% else %>
							<%= link_to(respondent.name, show_friend_path(respondent),:class => "entity_link") %><%= @author_or_response %>
						<% end %>
						<% if count > 0 %>
							</h5> 						
						<% else %>
							</h4>
						<% end %>
						<div>
							<p><%= r.content %></p>
							<p class="message_timestamp">posted on <%= r.created_at.to_formatted_s(:short) %></p>
						</div>
						<% count += 1 %>
					</div>
				<% end %>
				<%= link_to "Reply", create_public_response_path(@m) %>			
			</div>
		<% else %>
			<p><%= author.name + " does not authorise you to view this message" %></p>
		<% end %>
	<% else %>	
		<div class="single_popsicle_message">
			<% @m.get_responses.each do |r| %>
				<div class="single_popsicle_response" style="border-bottom:dashed" >
					<% respondent = Entity.find(r.private_author_id) %>
					<div style="display:inline">
						<h4 style="display:inline"><%= link_to(respondent.name, show_friend_path(respondent),:class => 'entity_link') %></h4>
						<p style="display:inline"> sent you a message about <span><%= r.subject %></span>, it says: </p>
					</div>
					<div>
						<p><%= r.content %></p>
						<p class="message_timestamp">posted on <%= r.created_at.to_formatted_s(:short) %></p>
					</div>
					<% @last_message = r %>
				</div>
			<% end %>
			<%= link_to "Reply", create_private_response_path(@last_message) %>
		</div>		
	<% end %> 
<% end %>